Skip to content

Mocking param matcher#105

Merged
syyyr merged 4 commits into
mainfrom
mocking-param-matcher
Mar 26, 2026
Merged

Mocking param matcher#105
syyyr merged 4 commits into
mainfrom
mocking-param-matcher

Conversation

@j4r0u53k
Copy link
Copy Markdown
Collaborator

No description provided.

…hing

Replaces rigid &str parameter matching in `await_signal` and `await_request`
with a new `ParamMatcher` trait. This allows for:
 - Exact matching using CPON strings (backward compatible).
 - Custom matching logic using closures/functions that operate on a
   RpcValue.

This change increases the flexibility of the mocking utility by allowing
dynamic or partial validation of RPC parameters during tests.
Reported by clippy.
@j4r0u53k j4r0u53k requested a review from syyyr March 25, 2026 17:07
@github-actions
Copy link
Copy Markdown

Code coverage report for 02b4bea

Coverage difference

✅ All new changes were covered.

Filename Stmts Miss Cover Missing
TOTAL 0 0 +100.00%

Overall coverage

Click to expand
Filename Stmts Miss Cover Missing
src/connection.rs 183 85 53.55% 33-37, 65, 102, 106-119, 128, 149-154, 179-184, 192, 198-201, 215-221, 228-229, 238-242, 248-249, 259-302, 309
src/clientnode.rs 491 65 86.76% 31-35, 82-86, 93-97, 104, 111-112, 176-197, 335, 339, 344-351, 376-379, 416-422, 516-517, 525, 531-536, 678, 695, 789, 815, 859, 873
src/appnodes.rs 27 20 25.93% 74-154
src/client.rs 990 86 91.31% 107, 168-170, 188-190, 214-220, 241, 248, 311-313, 349-353, 374-379, 396, 411-429, 441-442, 452, 470-473, 490-502, 516, 533, 540-542, 581-586, 591, 598-601, 628, 640-642, 674, 712, 720, 726, 799, 1297, 1310-1313
src/macros.rs 4 0 100.00%
src/clientapi.rs 325 140 56.92% 48-53, 63-65, 71, 76, 94-138, 162-166, 185-191, 210-213, 219-225, 240-243, 265-267, 272, 276-279, 281, 296-297, 324-327, 332, 337, 347-348, 416-454, 470-473, 488-500, 520-522, 565-570, 578-581, 586-588
src/runtime.rs 15 3 80.00% 17-19
TOTAL 2035 399 80.39%

HTML reports

@syyyr syyyr merged commit 2e44fa1 into main Mar 26, 2026
11 checks passed
@syyyr syyyr deleted the mocking-param-matcher branch March 26, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants